<?php

include_once($ROOT . "base.inc.php");

class PageController extends BaseController {
  var $newsItem;
  var $newsItems;

  function PageController() {
	parent::__construct();

	$this->title="News Entries";
	$this->section="news";

	$action = $this->getParameter("action");
	$this->newsItem = new NewsItem();

	switch (strtoupper($action))
	{
		case "SEARCH":
			$this->parseForm();

			$this->newsItems = NewsLogic::findByExample($this->newsItem);
			break;

		default :
			$this->newsItems = NewsLogic::findAll();
	}

  }

  function parseForm() {
	$this->newsItem->readForm();
  }

  function validate() {
	return (sizeof($this->errs) == 0);
  }

}



?>
